<?php
/**
 * 内容列表
 *
 * @version        $Id: content_i_list.php 1 14:31 2010年7月12日Z tianya $
 * @package        DedeCMS.Administrator
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once(dirname(__FILE__).'/config.php');
$type_id = '';

if(empty($_GET['qstr'])){
    $s_tmplets = "templets/content_cj_list.htm";
    $type_id = 'cj';
    include(dirname(__FILE__)."/content_list.php");

}else{

    if($_GET['dopost'] == 'adArcs'){

        if(empty($_GET['qstr']))
        {
            ShowMsg('对不起，你没指定运行参数！','-1');
            exit();
        }

        $qstrs = explode("`",$_GET['qstr']);

        if(!empty($qstrs)){

            foreach($qstrs as $aid){

                $sql = "SELECT * FROM `#@__archives` WHERE arcrank != '-1' AND id = '$aid'";
                $row = $dsql->GetOne($sql);

                if($row){

                    $res = $dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET is_index='1' WHERE id='$aid' ");

                    if($res){
                        ShowMsg("操作成功，请及时更新主页！","content_cj_list.php",'',2);
                    }
                }else{
                    ShowMsg('对不起，ID:'.$aid.' 信息有误或未审核，请及时联系工程师','-1');
                    exit();
                }
            }
        }else{
            ShowMsg('对不起，你没指定运行参数！','-1');
            exit();
        }
    }else if($_GET['dopost'] == 'deArcs'){

        if(empty($_GET['qstr']))
        {
            ShowMsg('对不起，你没指定运行参数！','-1');
            exit();
        }

        $qstrs = explode("`",$_GET['qstr']);

        if(!empty($qstrs)){

            foreach($qstrs as $aid){

                $sql = "SELECT * FROM `#@__archives` WHERE arcrank != '-1' AND is_index='1' AND id = '$aid'";
                $row = $dsql->GetOne($sql);

                if($row){

                    $res = $dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET is_index='0' WHERE id='$aid' ");

                    if($res){
                        ShowMsg("操作成功，请及时更新主页！","content_cj_list.php",'',2);
                    }
                }else{
                    ShowMsg('选择的素材存在未审核或未显示，请及时查看并联系工程师','-1');
                    exit();
                }
            }
        }else{
            ShowMsg('对不起，你没指定运行参数！','-1');
            exit();
        }
    }else{
        ShowMsg('对不起，你没指定运行参数！','-1');
        exit();
    }


}
